#!/bin/sh
# Author: alfred  < E-mail: zhanghailong@xao.ac.cn >
# The script to add user
# /etc/passwd info
echo "please imput username:"
read name
echo "please input number: (the user's num you want to add)"
read num
n=1
while [ $n -le $num  ]
do
    /usr/sbin/useradd $name$n
    n=`expr $n + 1 `
done


# /etc/shadow info
echo "please input the password"
read passwd
m=1
while [ $m -le $num  ] 
do
     echo $passwd | /usr/bin/passwd --stdin $name$m > /dev/null
     m=`expr $m + 1`
done
   
